package org.springblade.modules.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.admin.entity.MaintainParts;
import org.springblade.modules.admin.vo.MaintainPartsTreeVO;
import org.springblade.modules.admin.vo.MaintainPartsVO;
import org.springblade.modules.admin.vo.MaintainPartsWithAttributesTreeVO;

import java.util.List;
import java.util.Set;

public interface MaintainPartsMapper extends BaseMapper<MaintainParts> {

    List<MaintainPartsVO> partsList(@Param("maintainParts") MaintainParts maintainParts);

	List<MaintainPartsTreeVO> partsTree(@Param("maintainParts") MaintainParts maintainParts);

	List<MaintainParts> selectAll();

	/**
	 * 查询结构模板关联的配件及配件子配件
	 * @param partsIds
	 * @return
	 */
    List<MaintainPartsTreeVO> getPartsChildList(@Param("partsIds") String partsIds, @Param("elevatorId") Long elevatorId);

	/**
	 * 查询结构模板关联的父配件
	 * @param parentIds
	 * @return
	 */
	List<MaintainPartsTreeVO> getPartsParentByIds(@Param("parentIds") Set<String> parentIds, @Param("elevatorId") Long elevatorId);

	List<MaintainPartsWithAttributesTreeVO> partsTreeWithAttributes(@Param("maintainParts") MaintainParts maintainParts);
}
